<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>RPMsg-Lite User&#39;s Guide: RPMsg Queue Component</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="customdoxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="nxp_logo_small.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">RPMsg-Lite User&#39;s Guide
   &#160;<span id="projectnumber">Rev. 3.1.0</span>
   </div>
   <div id="projectbrief">NXP Semiconductors</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="modules.html"><span>API&#160;Reference</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__rpmsg__queue.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">RPMsg Queue Component</div>  </div>
</div><!--header-->
<div class="contents">

<p>This section describes the RPMsg Queue component that allows:  
<a href="#details">More...</a></p>
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<p>This section describes the RPMsg Queue component that allows: </p>
<ul>
<li>Blocking reception.</li>
<li>Zero-copy blocking reception. </li>
</ul>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:gaa6d197ceb3befc71d29f7b4a969d3d3e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="gaa6d197ceb3befc71d29f7b4a969d3d3e"></a>
typedef void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__rpmsg__queue.html#gaa6d197ceb3befc71d29f7b4a969d3d3e">rpmsg_queue_handle</a></td></tr>
<tr class="memdesc:gaa6d197ceb3befc71d29f7b4a969d3d3e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Rpmsg queue handle type. <br /></td></tr>
<tr class="separator:gaa6d197ceb3befc71d29f7b4a969d3d3e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gaeb7cba094390762f1131884b2c7e89ce"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__rpmsg__queue.html#gaeb7cba094390762f1131884b2c7e89ce">rpmsg_queue_rx_cb</a> (void *payload, uint32_t payload_len, uint32_t src, void *priv)</td></tr>
<tr class="memdesc:gaeb7cba094390762f1131884b2c7e89ce"><td class="mdescLeft">&#160;</td><td class="mdescRight">This callback needs to be registered with an endpoint.  <a href="#gaeb7cba094390762f1131884b2c7e89ce">More...</a><br /></td></tr>
<tr class="separator:gaeb7cba094390762f1131884b2c7e89ce"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf2b13335342ec06d8c264bbb6e27c88f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__rpmsg__queue.html#gaa6d197ceb3befc71d29f7b4a969d3d3e">rpmsg_queue_handle</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__rpmsg__queue.html#gaf2b13335342ec06d8c264bbb6e27c88f">rpmsg_queue_create</a> (struct <a class="el" href="group__rpmsg__lite.html#structrpmsg__lite__instance">rpmsg_lite_instance</a> *rpmsg_lite_dev)</td></tr>
<tr class="memdesc:gaf2b13335342ec06d8c264bbb6e27c88f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a RPMsg queue which can be used for blocking reception.  <a href="#gaf2b13335342ec06d8c264bbb6e27c88f">More...</a><br /></td></tr>
<tr class="separator:gaf2b13335342ec06d8c264bbb6e27c88f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga480a59ddeeef5f54f84cd3977efcd1ec"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__rpmsg__queue.html#ga480a59ddeeef5f54f84cd3977efcd1ec">rpmsg_queue_destroy</a> (struct <a class="el" href="group__rpmsg__lite.html#structrpmsg__lite__instance">rpmsg_lite_instance</a> *rpmsg_lite_dev, <a class="el" href="group__rpmsg__queue.html#gaa6d197ceb3befc71d29f7b4a969d3d3e">rpmsg_queue_handle</a> q)</td></tr>
<tr class="memdesc:ga480a59ddeeef5f54f84cd3977efcd1ec"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destroy a queue and clean up. Do not destroy a queue which is registered with an active endpoint!  <a href="#ga480a59ddeeef5f54f84cd3977efcd1ec">More...</a><br /></td></tr>
<tr class="separator:ga480a59ddeeef5f54f84cd3977efcd1ec"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaaed084bf79a613f41f0e100250ba2a99"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__rpmsg__queue.html#gaaed084bf79a613f41f0e100250ba2a99">rpmsg_queue_recv</a> (struct <a class="el" href="group__rpmsg__lite.html#structrpmsg__lite__instance">rpmsg_lite_instance</a> *rpmsg_lite_dev, <a class="el" href="group__rpmsg__queue.html#gaa6d197ceb3befc71d29f7b4a969d3d3e">rpmsg_queue_handle</a> q, uint32_t *src, char *data, uint32_t maxlen, uint32_t *len, uint32_t timeout)</td></tr>
<tr class="memdesc:gaaed084bf79a613f41f0e100250ba2a99"><td class="mdescLeft">&#160;</td><td class="mdescRight">blocking receive function - blocking version of the received function that can be called from an RTOS task. The data is copied from the receive buffer into the user supplied buffer.  <a href="#gaaed084bf79a613f41f0e100250ba2a99">More...</a><br /></td></tr>
<tr class="separator:gaaed084bf79a613f41f0e100250ba2a99"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5b6528593ab94d2377967a1cf2ec6180"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__rpmsg__queue.html#ga5b6528593ab94d2377967a1cf2ec6180">rpmsg_queue_recv_nocopy</a> (struct <a class="el" href="group__rpmsg__lite.html#structrpmsg__lite__instance">rpmsg_lite_instance</a> *rpmsg_lite_dev, <a class="el" href="group__rpmsg__queue.html#gaa6d197ceb3befc71d29f7b4a969d3d3e">rpmsg_queue_handle</a> q, uint32_t *src, char **data, uint32_t *len, uint32_t timeout)</td></tr>
<tr class="memdesc:ga5b6528593ab94d2377967a1cf2ec6180"><td class="mdescLeft">&#160;</td><td class="mdescRight">blocking receive function - blocking version of the received function that can be called from an RTOS task. The data is NOT copied into the user-app. buffer.  <a href="#ga5b6528593ab94d2377967a1cf2ec6180">More...</a><br /></td></tr>
<tr class="separator:ga5b6528593ab94d2377967a1cf2ec6180"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1c3cff098b9464fa89788510bda231a3"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__rpmsg__queue.html#ga1c3cff098b9464fa89788510bda231a3">rpmsg_queue_nocopy_free</a> (struct <a class="el" href="group__rpmsg__lite.html#structrpmsg__lite__instance">rpmsg_lite_instance</a> *rpmsg_lite_dev, void *data)</td></tr>
<tr class="memdesc:ga1c3cff098b9464fa89788510bda231a3"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function frees a buffer previously returned by <a class="el" href="group__rpmsg__queue.html#ga5b6528593ab94d2377967a1cf2ec6180" title="blocking receive function - blocking version of the received function that can be called from an RTOS...">rpmsg_queue_recv_nocopy()</a>.  <a href="#ga1c3cff098b9464fa89788510bda231a3">More...</a><br /></td></tr>
<tr class="separator:ga1c3cff098b9464fa89788510bda231a3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2d65626ac1279a50be5e1f86ed80acbf"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__rpmsg__queue.html#ga2d65626ac1279a50be5e1f86ed80acbf">rpmsg_queue_get_current_size</a> (<a class="el" href="group__rpmsg__queue.html#gaa6d197ceb3befc71d29f7b4a969d3d3e">rpmsg_queue_handle</a> q)</td></tr>
<tr class="memdesc:ga2d65626ac1279a50be5e1f86ed80acbf"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function returns the number of pending messages in the queue.  <a href="#ga2d65626ac1279a50be5e1f86ed80acbf">More...</a><br /></td></tr>
<tr class="separator:ga2d65626ac1279a50be5e1f86ed80acbf"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="gaeb7cba094390762f1131884b2c7e89ce"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t rpmsg_queue_rx_cb </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>payload</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>payload_len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>priv</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This callback needs to be registered with an endpoint. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">payload</td><td>Pointer to the buffer containing received data </td></tr>
    <tr><td class="paramname">payload_len</td><td>Size of data received, in bytes </td></tr>
    <tr><td class="paramname">src</td><td>Pointer to address of the endpoint from which data is received </td></tr>
    <tr><td class="paramname">priv</td><td>Private data provided during endpoint creation</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>RL_HOLD or RL_RELEASE to release or hold the buffer in payload </dd></dl>

</div>
</div>
<a class="anchor" id="gaf2b13335342ec06d8c264bbb6e27c88f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__rpmsg__queue.html#gaa6d197ceb3befc71d29f7b4a969d3d3e">rpmsg_queue_handle</a> rpmsg_queue_create </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="group__rpmsg__lite.html#structrpmsg__lite__instance">rpmsg_lite_instance</a> *&#160;</td>
          <td class="paramname"><em>rpmsg_lite_dev</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Create a RPMsg queue which can be used for blocking reception. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">rpmsg_lite_dev</td><td>RPMsg Lite instance</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>RPMsg queue handle or RL_NULL </dd></dl>

</div>
</div>
<a class="anchor" id="ga480a59ddeeef5f54f84cd3977efcd1ec"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t rpmsg_queue_destroy </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="group__rpmsg__lite.html#structrpmsg__lite__instance">rpmsg_lite_instance</a> *&#160;</td>
          <td class="paramname"><em>rpmsg_lite_dev</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__rpmsg__queue.html#gaa6d197ceb3befc71d29f7b4a969d3d3e">rpmsg_queue_handle</a>&#160;</td>
          <td class="paramname"><em>q</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Destroy a queue and clean up. Do not destroy a queue which is registered with an active endpoint! </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir"></td><td class="paramname">rpmsg_lite_dev</td><td>RPMsg-Lite instance </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">q</td><td>RPMsg queue handle to destroy</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Status of function execution </dd></dl>

</div>
</div>
<a class="anchor" id="gaaed084bf79a613f41f0e100250ba2a99"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t rpmsg_queue_recv </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="group__rpmsg__lite.html#structrpmsg__lite__instance">rpmsg_lite_instance</a> *&#160;</td>
          <td class="paramname"><em>rpmsg_lite_dev</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__rpmsg__queue.html#gaa6d197ceb3befc71d29f7b4a969d3d3e">rpmsg_queue_handle</a>&#160;</td>
          <td class="paramname"><em>q</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>maxlen</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>timeout</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>blocking receive function - blocking version of the received function that can be called from an RTOS task. The data is copied from the receive buffer into the user supplied buffer. </p>
<p>This is the "receive with copy" version of the RPMsg receive function. This version is simple to use but it requires copying data from shared memory into the user space buffer. The user has no obligation or burden to manage the shared memory buffers.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir"></td><td class="paramname">rpmsg_lite_dev</td><td>RPMsg-Lite instance </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">q</td><td>RPMsg queue handle to listen on </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>Pointer to the user buffer the received data are copied to </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">len</td><td>Pointer to an int variable that will contain the number of bytes actually copied into the buffer </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">maxlen</td><td>Maximum number of bytes to copy (received buffer size) </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">src</td><td>Pointer to address of the endpoint from which data is received </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">timeout</td><td>Timeout, in milliseconds, to wait for a message. A value of 0 means don't wait (non-blocking call). A value of 0xffffffff means wait forever (blocking call).</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Status of function execution</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__rpmsg__queue.html#ga5b6528593ab94d2377967a1cf2ec6180" title="blocking receive function - blocking version of the received function that can be called from an RTOS...">rpmsg_queue_recv_nocopy</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ga5b6528593ab94d2377967a1cf2ec6180"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t rpmsg_queue_recv_nocopy </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="group__rpmsg__lite.html#structrpmsg__lite__instance">rpmsg_lite_instance</a> *&#160;</td>
          <td class="paramname"><em>rpmsg_lite_dev</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__rpmsg__queue.html#gaa6d197ceb3befc71d29f7b4a969d3d3e">rpmsg_queue_handle</a>&#160;</td>
          <td class="paramname"><em>q</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>src</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char **&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>timeout</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>blocking receive function - blocking version of the received function that can be called from an RTOS task. The data is NOT copied into the user-app. buffer. </p>
<p>This is the "zero-copy receive" version of the RPMsg receive function. No data is copied. Only the pointer to the data is returned. This version is fast, but it requires the user to manage buffer allocation. Specifically, the user must decide when a buffer is no longer in use and make the appropriate API call to free it, see <a class="el" href="group__rpmsg__queue.html#ga1c3cff098b9464fa89788510bda231a3" title="This function frees a buffer previously returned by rpmsg_queue_recv_nocopy(). ">rpmsg_queue_nocopy_free()</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir"></td><td class="paramname">rpmsg_lite_dev</td><td>RPMsg Lite instance </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">q</td><td>RPMsg queue handle to listen on </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">data</td><td>Pointer to the RPMsg buffer of the shared memory where the received data is stored </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">len</td><td>Pointer to an int variable that that will contain the number of valid bytes in the RPMsg buffer </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">src</td><td>Pointer to address of the endpoint from which data is received </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">timeout</td><td>Timeout, in milliseconds, to wait for a message. A value of 0 means don't wait (non-blocking call). A value of 0xffffffff means wait forever (blocking call).</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Status of function execution.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__rpmsg__queue.html#ga1c3cff098b9464fa89788510bda231a3" title="This function frees a buffer previously returned by rpmsg_queue_recv_nocopy(). ">rpmsg_queue_nocopy_free</a> </dd>
<dd>
<a class="el" href="group__rpmsg__queue.html#gaaed084bf79a613f41f0e100250ba2a99" title="blocking receive function - blocking version of the received function that can be called from an RTOS...">rpmsg_queue_recv</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ga1c3cff098b9464fa89788510bda231a3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t rpmsg_queue_nocopy_free </td>
          <td>(</td>
          <td class="paramtype">struct <a class="el" href="group__rpmsg__lite.html#structrpmsg__lite__instance">rpmsg_lite_instance</a> *&#160;</td>
          <td class="paramname"><em>rpmsg_lite_dev</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function frees a buffer previously returned by <a class="el" href="group__rpmsg__queue.html#ga5b6528593ab94d2377967a1cf2ec6180" title="blocking receive function - blocking version of the received function that can be called from an RTOS...">rpmsg_queue_recv_nocopy()</a>. </p>
<p>Once the zero-copy mechanism of receiving data is used, this function has to be called to free a buffer and to make it available for the next data transfer.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir"></td><td class="paramname">rpmsg_lite_dev</td><td>RPMsg-Lite instance </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>Pointer to the RPMsg buffer of the shared memory that has to be freed</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Status of function execution.</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__rpmsg__queue.html#ga5b6528593ab94d2377967a1cf2ec6180" title="blocking receive function - blocking version of the received function that can be called from an RTOS...">rpmsg_queue_recv_nocopy</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ga2d65626ac1279a50be5e1f86ed80acbf"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t rpmsg_queue_get_current_size </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__rpmsg__queue.html#gaa6d197ceb3befc71d29f7b4a969d3d3e">rpmsg_queue_handle</a>&#160;</td>
          <td class="paramname"><em>q</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function returns the number of pending messages in the queue. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">q</td><td>RPMsg queue handle</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Number of pending messages in the queue. </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.5-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul class="foot">
    <li class="footer">Copyright 2016-2020 NXP Semiconductors. All rights reserved.
    </li>
  </ul>
</div>
</body>
</html>
